package com.tamtamy.jttamobile.parser;

import com.tamtamy.jttamobile.data.Comment;
import com.tamtamy.jttamobile.data.CommentList;
import com.tamtamy.jttamobile.data.Content;
import com.tamtamy.jttamobile.data.ContentLink;
import com.tamtamy.jttamobile.data.ContentList;
import com.tamtamy.jttamobile.data.ContentMessage;
import com.tamtamy.jttamobile.data.ContentWidget;
import com.tamtamy.jttamobile.data.GroupDetails;
import com.tamtamy.jttamobile.data.GroupList;
import com.tamtamy.jttamobile.data.Metadata;
import com.tamtamy.jttamobile.data.NetworkDetails;
import com.tamtamy.jttamobile.data.NetworkList;
import com.tamtamy.jttamobile.data.Notice;
import com.tamtamy.jttamobile.data.NoticeList;
import com.tamtamy.jttamobile.data.OnLineUsersList;
import com.tamtamy.jttamobile.data.TagDetail;
import com.tamtamy.jttamobile.data.TagList;
import com.tamtamy.jttamobile.data.Token;
import com.tamtamy.jttamobile.data.UserDetail;
import com.tamtamy.jttamobile.data.UserStatsGenerationDetails;
import com.tamtamy.jttamobile.data.UserStatsGenerationList;
import com.tamtamy.jttamobile.data.UserStatsList;
import com.tamtamy.jttamobile.data.UserTag;
import com.tamtamy.jttamobile.data.UsersList;
import com.tamtamy.jttamobile.exception.JTTAException;
import com.tamtamy.jttamobile.exception.ParsingException;
import com.tamtamy.jttamobile.exception.UnauthorizedException;

/**
 * @author a.pellegatta
 *
 */
public interface Parser {

	/**
	 * @param username
	 * @param password
	 * @throws JTTAException
	 */
	public Token doLogin(String username, String password) throws UnauthorizedException;

	/**
	 * Check login without changing the parameter inside. Useful for testing if data are correct
	 * @param tamtamyUrl
	 * @param username
	 * @param password
	 * @return
	 * @throws UnauthorizedException
	 */
	public Token tryLogin(String tamtamyUrl, String username, String password) throws UnauthorizedException; 
	/**
	 * @param username
	 * @param token
	 * @throws JTTAException
	 */
	public boolean isValidToken(String username, String token);
	
	/**
	 * @throws JTTAException
	 */
	public void doLogout() throws JTTAException;
	
	/**
	 * @param startOffset
	 * @param limit
	 * @return
	 * @throws JTTAException
	 */
	public TagList getTagList(long startOffset, long limit) throws JTTAException;
	
	/**
	 * @param tag
	 * @return
	 * @throws JTTAException
	 */
	public TagDetail getTagDetail(String tag) throws JTTAException;
	
	/**
	 * @param startOffset
	 * @param limit
	 * @param filter
	 * @param order
	 * @return
	 * @throws JTTAException
	 * @throws ParsingException
	 */
	public ContentList getContentList(long startOffset, long limit, String filter, String order) throws JTTAException, ParsingException;
	
	/**
	 * @param contentID
	 * @return
	 * @throws JTTAException
	 */
	public Content getContent(String contentID) throws JTTAException ;
	
	/**
	 * @param contentID
	 * @return
	 * @throws JTTAException
	 */
	public Content getContentFile(String contentID) throws JTTAException ;
	
	/**
	 * @param contentID
	 * @return
	 * @throws JTTAException
	 */
	public ContentLink getContentLink(String contentID) throws JTTAException;
	
	/**
	 * @param contentID
	 * @return
	 * @throws JTTAException
	 */
	public ContentMessage getContentMessage(String contentID) throws JTTAException;
	
	/**
	 * @param contentID
	 * @return
	 * @throws JTTAException
	 */
	public ContentWidget getContentWidget(String contentID) throws JTTAException;
	
	/**
	 * @param startOffset
	 * @param limit
	 * @return
	 * @throws JTTAException
	 * @throws ParsingException
	 */
	public CommentList getCommentList(long startOffset, long limit)	throws JTTAException, ParsingException;
	
	/**
	 * @param contentID
	 * @param startOffset
	 * @param limit
	 * @return
	 * @throws JTTAException
	 * @throws ParsingException
	 */
	public CommentList getCommentsList(long contendID, long startOffset, long limit)	throws JTTAException, ParsingException;
	
	/**
	 * @param commentID
	 * @return
	 * @throws JTTAException
	 */
	public Comment getComment(long commentID) throws JTTAException, ParsingException;
	
	/**
	 * @param startOffset
	 * @param limit
	 * @param filter
	 * @return
	 * @throws JTTAException
	 * @throws ParsingException
	 */
	public NoticeList getNoticeList(long startOffset, long limit, String filter, String userId, String fromDate, String toDate) throws JTTAException,ParsingException;
	
	/**
	 * @param noticeID
	 * @return
	 * @throws JTTAException
	 */
	public Notice getNotice(long noticeID) throws JTTAException;
	
	/**
	 * @param userID
	 * @param startOffset
	 * @param limit
	 * @return
	 * @throws JTTAException
	 */
	public UserStatsList getUserStatsList(String userID, long startOffset, long limit) throws JTTAException;
	
	/**
	 * @param startOffset
	 * @param limit
	 * @return
	 * @throws JTTAException
	 * @throws ParsingException
	 */
	public UserStatsGenerationList getUserStatsGenerationList(long startOffset,	long limit) throws JTTAException,ParsingException;
	
	/**
	 * @param userStatsID
	 * @param startOffset
	 * @param limit
	 * @return
	 * @throws JTTAException
	 */
	public UserStatsGenerationDetails getUserStatsGenerationDetails(String userStatsID, long startOffset, long limit) throws JTTAException;
	
	/**
	 * @param startOffset
	 * @param limit
	 * @return
	 * @throws JTTAException
	 * @throws ParsingException
	 */
	public GroupList getGroupList(long startOffset, long limit) throws JTTAException, ParsingException;
	
	/**
	 * @param groupID
	 * @return
	 * @throws JTTAException
	 */
	public GroupDetails getGroupDetails(String groupID) throws JTTAException;
	
	/**
	 * @param startOffset
	 * @param limit
	 * @return
	 * @throws JTTAException
	 * @throws ParsingException
	 */
	public NetworkList getNetworkList(long startOffset, long limit) throws JTTAException,ParsingException;
	
	/**
	 * @param startOffset
	 * @param limit
	 * @param filter
	 * @return
	 * @throws JTTAException
	 * @throws ParsingException
	 */
	public NetworkList getNetworkListWithChatEnabled(long startOffset, long limit, String filter) throws JTTAException,ParsingException;
	
	/**
	 * @param startOffset
	 * @param limit
	 * @return
	 * @throws JTTAException
	 * @throws ParsingException
	 */
	public NetworkList getNetworkListWithChatEnabled(long startOffset, long limit) throws JTTAException,ParsingException;
	
	/**
	 * @param startOffset
	 * @param limit
	 * @param filter
	 * @return
	 * @throws JTTAException
	 * @throws ParsingException
	 */
	public NetworkList getNetworkList(long startOffset, long limit, String filter) throws JTTAException,ParsingException;
	
	/**
	 * @param networkID
	 * @return
	 * @throws JTTAException
	 */
	public NetworkDetails getNetworkDetails(String networkID) throws JTTAException;
	
	/**
	 * @param url
	 * @return
	 * @throws JTTAException
	 * @throws ParsingException
	 */
	public Metadata getMetadata(String url) throws JTTAException,ParsingException;
	
	/**
	 * @param filter
	 * @return
	 * @throws JTTAException
	 */
	public UserTag getUserTag(String filter) throws JTTAException;
	
	/**
	 * @param userID
	 * @param filter
	 * @return
	 * @throws JTTAException
	 */
	public UserTag getUserTag(String userID, String filter) throws JTTAException;
	
	/**
	 * @param startOffset
	 * @param limit
	 * @param filter
	 * @return
	 * @throws JTTAException
	 * @throws ParsingException
	 */
	public UsersList getUsersList(long startOffset, long limit, String filter) throws JTTAException,ParsingException;
	
	/**
	 * @param startOffset
	 * @param limit
	 * @return
	 * @throws JTTAException
	 */
	public OnLineUsersList getOnLineUsersList(long startOffset, long limit) throws JTTAException;
	
	/**
	 * @param userID
	 * @return
	 * @throws JTTAException
	 */
	public UserDetail getUserDetail(String userID) throws JTTAException;
	
	/**
	 * @param contentID
	 * @throws JTTAException
	 */
	public void downloadContent(String contentID) throws JTTAException;
	
	/**
	 * @param url
	 * @return
	 * @throws JTTAException
	 */
	public Object getData(String url) throws JTTAException;
	
	
	

}
